﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Santa_sAdventure.View
{
    class Camera
    {
        // Variables
        // Screen width and height
        private int m_screenWidth;
        private int m_screenHeight;
        private float m_scale;

        // Construct
        internal Camera(int a_screenWidth, int a_screenHeight, float a_scale)
        {
            m_screenWidth = a_screenWidth;
            m_screenHeight = a_screenHeight;
            m_scale = a_scale;
        }

        // Set camera scale
        internal void SetScale(float a_scale)
        {
            m_scale = a_scale;
        }

        // Returns a visual rectangle
        internal Rectangle GetVisualRectangle(float a_x, float a_y, float a_xSize , float a_ySize)
        {
            int xPos = (int)(a_x  * (m_screenWidth / m_scale));
            int yPos = (int)(a_y  * (m_screenHeight / m_scale));

            int width = (int)(a_xSize * (m_screenWidth / m_scale));
            int height = (int)(a_ySize * (m_screenHeight / m_scale));

            return new Rectangle(xPos, yPos, width, height);
        }
    }
}
